Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ied name Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
dbt's native unit tests create their scratch relation with
create or replace temporary table "DB"."S"."MODEL__dbt_tmp" as (...), thendescribe tableit and drop it. Qualified temporary table names fail in fakesnow, because DuckDB keeps every temporary table in its session-widetempcatalog and rejects any other qualifier, so these tests can't run (#458). DESCRIBE of a temporary table also returned no columns, even unqualified.How?
Temporary tables keep the Snowflake schema they were created in (the record
TableStagesalready holds for table stages), and references that resolve to that schema are rewritten to DuckDB'stemp.main. A temporary table therefore shadows a permanent table of the same name only in its own schema, and isn't found by its unqualified name from another schema. Temporary tables' VARCHAR lengths and comments are recorded per table rather than per name, so sessions no longer see each other's, and the records go when the table is replaced or dropped.The first commit is what dbt needs; the other three (COPY INTO by qualified name, not finding a temporary table from another schema by its unqualified name, per-session metadata) are separate commits that can be dropped independently.
Fakesnow-specific limitations:
CLONEwhen it's a qualified temporary table,ALTER TABLE ... RENAMEandTRUNCATEof a qualified temporary table, three-part column references (db.schema.t.x), describe-only queries in server mode, and listing temporary tables in SHOW TABLES / INFORMATION_SCHEMA.TABLES.Fixes #458
🤖 Generated with Claude Code